package com.jeesite.modules.dataScreen.web.vo;

import cn.hutool.core.collection.CollUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Objects;


@Data
@ApiModel("民航数据")
public class AirportInformationVo {

    @ApiModelProperty("基础情况")
    private List<IndustryIndexVo> jc;

    @ApiModelProperty("跑道数量")
    private List<IndustryIndexVo> pd;

    @ApiModelProperty("旅客吞吐能力")
    private List<IndustryIndexVo> lkttnl;

    @ApiModelProperty("货邮吞吐能力")
    private List<IndustryIndexVo> hyttnl;

    @ApiModelProperty("机场等级")
    private List<IndustryIndexVo> level;

    @ApiModelProperty("机场航线")
    private List<IndustryIndexVo> hxls;

    @ApiModelProperty("江北机场事件万架次率")
    private IndustryIndexVo sjwjRate;

    @ApiModelProperty("江北机场旅客满意度")
    private IndustryIndexVo lkmydRate;

    @ApiModelProperty("民航建设-当年计划投资")
    private IndustryIndexVo mhjsjhtz;

    @ApiModelProperty("民航建设-已完成投资")
    private IndustryIndexVo mhjswctz;

    @ApiModelProperty("民航建设-投资进度")
    private IndustryIndexVo mhjstzRate;

    @ApiModelProperty("民航建设-在建项目数")
    private IndustryIndexVo mhjszjmns;


    @Data
    public static class Item {
        @ApiModelProperty("全市运输机场")
        private IndustryIndexVo qs;

        @ApiModelProperty("江北机场")
        private IndustryIndexVo jb;

        @ApiModelProperty("万州机场")
        private IndustryIndexVo wz;

        @ApiModelProperty("黔江机场")
        private IndustryIndexVo qj;

        @ApiModelProperty("巫山机场")
        private IndustryIndexVo ws;

        @ApiModelProperty("仙女山机场")
        private IndustryIndexVo xns;

        public List<IndustryIndexVo> getIndexVos() {
            if (Objects.nonNull(qs)) {
                return CollUtil.toList(jb, wz, qj, ws, xns, qs);
            }
            return CollUtil.toList(jb, wz, qj, ws, xns);
        }

//        public void buildTotal(String indicatorName) {
//            BigDecimal bigDecimal = IndustryIndexVo.addAll(qs, jb, wz, qj, ws, xns);
//            qs = new IndustryIndexVo(indicatorName, bigDecimal.toString(), jb.getUnit());
//        }
    }
}
